<template>
  <div class="app-container">
    <div class="filter-container">
      <!-- <el-input :placeholder="`${$t('common.table.id')}/${$t('member.cellphone')}/${$t('member.name')}`" v-model="listQuery.title" style="width: 200px;" class="filter-item"
        clearable @keyup.enter.native="handleFilter" />
      <span class="filter-item">
        <el-date-picker v-model="listQuery.timeInterval" :picker-options="pickerOptions" :range-separator="$t('common.to')" :start-placeholder="$t('date_picker.start_placeholder')"
          :end-placeholder="$t('date_picker.end_placeholder')" type="datetimerange" align="right" value-format="yyyy-MM-dd HH:mm:ss" />
      </span> -->
      <el-radio-group v-model="state" class="filter-item" @change="handleFilter">
        <el-radio-button :label="0">商品</el-radio-button>
        <el-radio-button :label="1">订单</el-radio-button>
        <el-radio-button :label="2">会员</el-radio-button>
      </el-radio-group>
      <!-- <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">{{ $t('common.search') }}</el-button> -->
      <!-- <el-button v-permission="$store.jurisdiction.MemberExport" :loading="formLoading" class="filter-item" style="margin-left: 10px;float:right;" icon="el-icon-download"
        @click="handleExport">{{ $t('common.export') }}</el-button>
      <el-button v-permission="$store.jurisdiction.MemberCreate" class="filter-item" style="margin-left: 10px;float:right;" type="primary" icon="el-icon-edit"
        @click="handleCreate">{{ $t('common.add') }}</el-button> -->
      <!--<el-button v-permisssion="jurisdiction.usersListExport" v-waves :loading="downloadLoading" class="filter-item" type="primary" icon="el-icon-download" @click="handleDownload">{{ $t('usuel.export') }}</el-button>-->
      <el-form v-if="state === 0" :inline="true" :model="listQuery" class="demo-form-inline">
        <el-form-item :label="$t('good.search.form.title.label')">
          <el-input v-model="listQuery.title" :placeholder="$t('good.search.form.title.placeholder')" clearable @keyup.enter.native="handleFilter" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="handleFilter">{{ $t('common.search') }}</el-button>
          <!-- {{ $t('good.search.form.category_id.label') }}: -->
          <!-- <el-cascader v-model="listQuery.category_id" :options="categorys" :props="{ expandTrigger: 'hover' }" clearable @change="changeCategorys" /> -->
        </el-form-item>
      </el-form>

      <el-form v-if="state === 1" :inline="true" :model="listQuery" class="demo-form-inline">
        <el-form-item :label="$t('good_indent.info')">
          <el-input :placeholder="$t('good_indent.placeholder.info')" v-model="listQuery.title" clearable />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="handleFilter">{{ $t('common.search') }}</el-button>
          <!-- <el-button v-permission="$store.jurisdiction.IndentExport" :loading="formLoading" icon="el-icon-download" @click="handleExport">{{ $t('common.export')
                 }}</el-button> -->
        </el-form-item>
      </el-form>
      <el-form v-if="state === 2" :inline="true" :model="listQuery" class="demo-form-inline">
        <el-input :placeholder="`${$t('common.table.id')}/${$t('member.cellphone')}/${$t('member.name')}`" v-model="listQuery.title" style="width: 200px;" class="filter-item"
          clearable @keyup.enter.native="handleFilter" />
        <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">{{ $t('common.search') }}</el-button>
      </el-form>
    </div>
    <div class="operation" style="margin-bottom: 10px;">
      <el-button size="mini" @click="handleCheckAllChange">{{ $t('common.check_all') }}/{{ $t('common.inverse') }}</el-button>
      <el-button :loading="formLoading" size="mini" type="danger" @click="handleAllDelete()">
        {{ $t('common.delete') }}</el-button>
    </div>
    <template v-if="state==0">
      <el-table v-loading="listLoading" ref="multipleTable" :data="list" border fit highlight-current-row style="width: 100%;" @sort-change="sortChange"
        @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" fixed="left" />
        <!-- <el-table-column label="序号" type="index" width="50" align="center">
          <template slot-scope="scope">
            {{ total - ((listQuery.page - 1) * listQuery.limit + scope.$index) }}
          </template>
        </el-table-column> -->

        <!-- <el-table-column :label="$t('good.table.id')" sortable="custom" prop="id" width="80">
        <template slot-scope="scope">
          <router-link :to="{ path: '/commodityManagement/good/goodDetail', query: { id: scope.row.id }}" target="_blank" style="width:300px;"> {{ scope.row.id }}</router-link>
        </template>
      </el-table-column> -->
        <el-table-column :label="$t('good.table.type')" sortable="custom" prop="type" width="120">
          <template slot-scope="scope">
            {{ scope.row.type }}
          </template>
        </el-table-column>
        <el-table-column :label="$t('good.table.img')" width="150">
          <template slot-scope="scope">
            <el-image :src="scope.row&&scope.row.resources&&scope.row.resources.img" :preview-src-list="[ scope.row&&scope.row.resources&&scope.row.resources.img ]"
              style="width:80px;height:80px;" />
          </template>
        </el-table-column>
        <el-table-column :label="$t('good.table.commodity')" width="200">
          <template slot-scope="scope">
            <div class="drawing">
              <div class="right">
                <div>{{ scope.row.name }}</div>
                <div v-if="scope.row&&scope.row.price_show&&scope.row.price_show.length > 1">₩{{ scope.row.price_show[0] | 1000 }} - {{ scope.row.price_show[1] | 1000 }}</div>
                <div v-else>₩{{ scope.row&&scope.row.price_show&&scope.row.price_show[0] | 1000 }}</div>
              </div>
            </div>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good.table.classify')" width="150">
          <template slot-scope="scope">
            <span>{{ scope.row.category ? scope.row.category.name : $t('common.table.nothing') }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good.table.number')" width="150">
          <template slot-scope="scope">
            <span>{{ scope.row.number }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good.table.inventory')" width="100">
          <template slot-scope="scope">
            <span>{{ scope.row.inventory_show }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good.table.sales')" sortable="custom" prop="sales" width="100">
          <template slot-scope="scope">
            <span>{{ scope.row.sales }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('common.table.state')" sortable="custom" prop="is_show" width="100">
          <template slot-scope="scope">
            <span>{{ scope.row.putaway_show }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good.table.is_inventory')" sortable="custom" prop="is_inventory" width="160">
          <template slot-scope="scope">
            <span>{{ scope.row.is_inventory_show }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good.table.is_recommend')" sortable="custom" prop="is_recommend" width="150">
          <template slot-scope="scope">
            <span>{{ scope.row.is_recommend === 1 ? $t('common.yes') : $t('common.no') }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column :label="$t('common.language')" width="200">
        <template slot-scope="scope">
          <lang-translate v-model="scope.row" @translate="handleTranslate" />
        </template>
      </el-table-column> -->
        <el-table-column :label="$t('good.table.time')" sortable="custom" prop="time" width="160">
          <template slot-scope="scope">
            <span>{{ scope.row.time ? scope.row.time : $t('good.table.unpublished') }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good.table.updated_at')" sortable="custom" prop="updated_at" width="160">
          <template slot-scope="scope">
            <span>{{ scope.row.updated_at }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作时间" sortable="custom" prop="deleted_at" width="160">
          <template slot-scope="scope">
            <span>{{ scope.row.deleted_at }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('common.operation')" class-name="small-padding fixed-width" width="140" fixed="right">
          <template slot-scope="scope">
            <el-button :loading="formLoading" type="primary" icon="el-icon-refresh-right" circle @click="handleRef(scope.row)" />
            <el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.row)" />
          </template>
        </el-table-column>
      </el-table>
      <!--分页-->
      <div class="pagination-operation">
        <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" class="pagination" @pagination="getList" />
      </div>
    </template>
    <template v-if="state==1">
      <el-table v-loading="listLoading" ref="multipleTable" :key="tableKey" :data="list" border fit highlight-current-row style="width: 100%;" @sort-change="sortChange"
        @selection-change="handleSelectionChange">

        <el-table-column type="selection" width="55" fixed="left" />
        <!-- <el-table-column label="序号" type="index" width="50" align="center">
          <template slot-scope="scope">
            {{ total - ((listQuery.page - 1) * listQuery.limit + scope.$index) }}
          </template>
        </el-table-column> -->
        <!-- <el-table-column :label="$t('good.table.id')" width="100" sortable="custom" prop="id">
        <template slot-scope="scope">
          <span>{{ scope.row.id }}</span>
        </template>
      </el-table-column> -->
        <el-table-column :label="$t('good_indent.identification')" width="180">
          <template slot-scope="scope">
            <span>{{ scope.row.identification }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.type')" width="120">
          <template slot-scope="scope">
            <span>{{ scope.row.type }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.state')" width="120" sortable="custom" prop="state">
          <template slot-scope="scope">
            <span>{{ scope.row.state_show }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.total')" width="120">
          <template slot-scope="scope">
            <span>{{ scope.row.total ? scope.row.total : 0 | 1000 }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('mode.payment')" width="100">
          <template slot-scope="scope">
            <span>{{ scope.row.pay_way==0?' ':scope.row.pay_way==6?"线下支付":scope.row.pay_way }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.carriage')" width="80">
          <template slot-scope="scope">
            <span v-if="scope.row.carriage">{{ scope.row.carriage | 1000 }}</span>
            <span v-else>{{ $t('good_indent.freight_free') }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.good_location')" width="100">
          <template slot-scope="scope">
            <span>{{ scope.row.good_location ? scope.row.good_location.name : '' }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.cellphone')" width="180">
          <template slot-scope="scope">
            <span>{{ scope.row.good_location ? scope.row.good_location.cellphone : '' }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.location')" width="200">
          <template slot-scope="scope">
            <span>{{ scope.row.good_location ? scope.row.good_location.location : '' }}</span>
          </template>
        </el-table-column>
        <el-table-column label="통관번호" width="150">
          <template slot-scope="scope">
            <span>{{ scope.row.good_location ? scope.row.good_location.address : '' }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.dhl')" width="80">
          <template slot-scope="scope">
            <span>{{ scope.row.dhl ? scope.row.dhl.name : '' }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.odd')" width="180">
          <template slot-scope="scope">
            <span>{{ scope.row.odd }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.remark')" width="100">
          <template slot-scope="scope">
            <span>{{ scope.row.remark }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('good_indent.created_at')" width="180" sortable="custom" prop="created_at">
          <template slot-scope="scope">
            <span>{{ scope.row.created_at }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作时间" sortable="custom" prop="deleted_at" width="160">
          <template slot-scope="scope">
            <span>{{ scope.row.deleted_at }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('common.operation')" class-name="small-padding fixed-width" width="140" fixed="right">
          <template slot-scope="scope">
            <el-button :loading="formLoading" type="primary" icon="el-icon-refresh-right" circle @click="handleRef(scope.row)" />
            <el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.row)" />
          </template>
        </el-table-column>
      </el-table>
      <!--分页-->
      <div class="pagination-operation">
        <pagination v-show="total > 0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" class="pagination" @pagination="getList" />
      </div>
    </template>
    <template v-if="state==2">
      <el-table v-loading="listLoading" ref="multipleTable" :key="tableKey" :data="list" border fit highlight-current-row style="width: 100%;" @sort-change="sortChange"
        @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" fixed="left" />
        <!-- <el-table-column label="序号" type="index" width="50" align="center">
          <template slot-scope="scope">
            {{ total - ((listQuery.page - 1) * listQuery.limit + scope.$index) }}
          </template>
        </el-table-column> -->
        <el-table-column :label="$t('member.name')" align="center" width="120">
          <template slot-scope="scope">
            <span>{{ scope.row.cellphone }}</span>
          </template>
        </el-table-column>
        <!-- <el-table-column :label="$t('member.portrait')" width="120">
          <template slot-scope="scope">
            <img :src="scope.row.portrait" style="width:45px;height:45px;">
          </template>
        </el-table-column> -->
        <el-table-column :label="$t('member.nickname')" align="center" width="120">
          <template slot-scope="scope">
            <span>{{ scope.row.nickname }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('member.gender')" align="center" width="120">
          <template slot-scope="scope">
            {{ scope.row.gender_show }}
          </template>
        </el-table-column>
        <el-table-column label="邮箱" align="center" width="120">
          <template slot-scope="scope">
            {{ scope.row.email }}
          </template>
        </el-table-column>
        <el-table-column :label="$t('member.money')" align="center" width="200">
          <template slot-scope="scope">
            {{ scope.row.money|1000 }}
          </template>
        </el-table-column>
        <el-table-column :label="$t('member.created_at')" sortable="custom" prop="time" width="200">
          <template slot-scope="scope">
            <span>{{ scope.row.created_at }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('member.updated_at')" sortable="custom" prop="time" width="200">
          <template slot-scope="scope">
            <span>{{ scope.row.updated_at }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('common.table.state')" align="center" width="120">
          <template slot-scope="scope">
            <span>{{ scope.row.state_show }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作时间" sortable="custom" prop="deleted_at" width="160">
          <template slot-scope="scope">
            <span>{{ scope.row.deleted_at }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('common.operation')" class-name="small-padding fixed-width" width="140" fixed="right">
          <template slot-scope="scope">
            <el-button :loading="formLoading" type="primary" icon="el-icon-refresh-right" circle @click="handleRef(scope.row)" />
            <el-button type="danger" icon="el-icon-delete" circle @click="handleDelete(scope.row)" />
          </template>
        </el-table-column>
      </el-table>
      <!--分页-->
      <pagination v-show="total>0" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="getList" />
    </template>
  </div>
</template>

<script>
import { getGoodList, getIndentList, getMebList, goodRestore, IndentRestore, MebRestore, goodDelete, IndentDelete, MebDelete, goodAdelete, IndentAdelete, mebAdelete } from '@/api/bin'
import waves from '@/directive/waves' // Waves directive
import Pagination from '@/components/Pagination'

export default {
  name: 'MemberList',
  components: { Pagination },
  directives: { waves },
  data() {
    var validateMobile = (rule, value, callback) => {
      if (value === '') {
        callback(new Error(this.$t('hint.error.please_enter', { attribute: this.$t('member.cellphone') })))
      } else {
        if (!(/^\d+$/.test(value))) {
          callback(new Error(this.$t('hint.error.wrong_format', { attribute: this.$t('member.cellphone') })))
        }
        callback()
      }
    }
    return {
      formLoading: false,
      actionurl: process.env.BASE_API + 'uploadPictures',
      uploadData: {},
      pickerOptions: {
        shortcuts: [{
          text: this.$t('usuel.latest_week'),
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: this.$t('usuel.last_month'),
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: this.$t('usuel.last_three_months'),
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
            picker.$emit('pick', [start, end])
          }
        }]
      },
      imageUrl: '',
      portrait: '',
      tableKey: 0,
      list: null,
      total: 0,
      multipleSelection: [],
      textMap: {
        update: this.$t('common.amend'),
        create: this.$t('common.add')
      },
      listLoading: true,
      state: 0,
      listQuery: {
        activeIndex: 0,
        type: 0,
        page: 1,
        limit: 10,
        sort: '-id'
      },
      temp: {
        password: '',
        gender: 0,
        name: '',
        cellphone: '',
        nickname: ''
      },
      dialogFormVisible: false,
      dialogStatus: '',
      adminRules: {
        name: [
          { required: true, message: this.$t('hint.error.please_enter', { attribute: this.$t('member.name') }), trigger: 'blur' }
        ],
        cellphone: [
          { required: true, message: this.$t('hint.error.please_enter', { attribute: this.$t('member.cellphone') }), trigger: 'blur' },
          { validator: validateMobile, trigger: 'blur' }
        ],
        password: [
          { required: true, message: this.$t('hint.error.please_enter', { attribute: this.$t('member.password') }), trigger: 'blur' }
        ]
      },
      downloadLoading: false
    }
  },
  created() {
    this.getList()
  },
  methods: {
    handleSelectionChange(val) { // 设置全选/全不选数据
      console.log('🚀 ~  val: ', val)
      this.multipleSelection = val
    },
    handleCheckAllChange() {
      this.$refs.multipleTable.toggleAllSelection()
    },
    handleDelete(row) { // 删除
      this.$confirm('是否删除数据', this.$t('common.hint'), {
        confirmButtonText: this.$t('common.confirm'),
        cancelButtonText: this.$t('common.cancel'),
        type: 'warning'
      }).then(() => {
        // this.formLoading = true
        if (this.state === 0) {
          goodDelete(row).then(response => {
            this.$notify({
              title: this.$t('common.succeed'),
              message: '删除成功',
              type: 'success',
              duration: 2000
            })
            this.getList()
          })
        } else if (this.state === 1) {
          IndentDelete(row).then(response => {
            this.$notify({
              title: this.$t('common.succeed'),
              message: '删除成功',
              type: 'success',
              duration: 2000
            })
            this.getList()
          })
        } else {
          MebDelete(row).then(response => {
            this.$notify({
              title: this.$t('common.succeed'),
              message: '删除成功',
              type: 'success',
              duration: 2000
            })
            this.getList()
          })
        }
      }).catch(() => {
      })
    },
    handleAllDelete() { // 批量删除
      this.$confirm('是否批量删除数据', this.$t('common.hint'), {
        confirmButtonText: this.$t('common.confirm'),
        cancelButtonText: this.$t('common.cancel'),
        type: 'warning'
      }).then(() => {
        console.log('🚀 ~  this.state: ', this.state)

        // this.formLoading = true
        if (this.state === 0) {
          goodAdelete(0, this.multipleSelection).then(response => {
            this.getList()
            this.$notify({
              title: this.$t('common.succeed'),
              message: '删除成功',
              type: 'success',
              duration: 2000
            })
          })
        } else if (this.state === 1) {
          IndentAdelete(0, this.multipleSelection).then(response => {
            this.getList()
            this.$notify({
              title: this.$t('common.succeed'),
              message: '删除成功',
              type: 'success',
              duration: 2000
            })
          })
        } else {
          mebAdelete(0, this.multipleSelection).then(response => {
            this.getList()
            this.$notify({
              title: this.$t('common.succeed'),
              message: '删除成功',
              type: 'success',
              duration: 2000
            })
          })
        }
      }).catch(() => {
      })
    },
    getList() {
      this.listLoading = true
      if (this.state === 0) {
        getGoodList(this.listQuery).then(response => {
          this.list = response.data.data
          this.total = response.data.total
          this.listLoading = false
        })
      } else if (this.state === 1) {
        getIndentList(this.listQuery).then(response => {
          this.list = response.data.data
          this.total = response.data.total
          this.listLoading = false
        })
      } else {
        getMebList(this.listQuery).then(response => {
          this.list = response.data.data
          this.total = response.data.total
          this.listLoading = false
        })
      }
    },
    handleRef(row) {
      this.$confirm('是否恢复数据', this.$t('common.hint'), {
        confirmButtonText: this.$t('common.confirm'),
        cancelButtonText: this.$t('common.cancel'),
        type: 'warning'
      }).then(() => {
        if (this.state === 0) {
          goodRestore(row).then(response => {
            this.$notify({
              title: this.$t('common.succeed'),
              message: '恢复成功',
              type: 'success',
              duration: 2000
            })
            this.getList()
          })
        } else if (this.state === 1) {
          IndentRestore(row).then(response => {
            this.$notify({
              title: this.$t('common.succeed'),
              message: '恢复成功',
              type: 'success',
              duration: 2000
            })
            this.getList()
          })
        } else {
          MebRestore(row).then(response => {
            this.$notify({
              title: this.$t('common.succeed'),
              message: '恢复成功',
              type: 'success',
              duration: 2000
            })
            this.getList()
          })
        }
      })
    },
    handleAvatarSuccess(res, file) { // 上传图片
      this.portrait = file.response
      this.imageUrl = URL.createObjectURL(file.raw)
    },
    beforeAvatarUpload(file) { // 上传图片
      const isLt2M = file.size / 1024 / 1024 < 2
      if (
        ['image/jpeg',
          'image/gif',
          'image/png'
        ].indexOf(file.type) === -1) {
        this.$message.error(this.$t('hint.upload.img.rmvb'))
        return false
      }
      if (!isLt2M) {
        this.$message.error(this.$t('hint.upload.img.can_not_surpass', { size: '2M' }))
      }
      this.imgProgress = true
      return isLt2M
    },
    handleFilter() {
      this.listQuery.page = 1
      this.getList()
    },
    sortChange(data) {
      const { prop, order } = data
      if (order === 'ascending') {
        this.listQuery.sort = '+' + prop
      } else {
        this.listQuery.sort = '-' + prop
      }
      this.handleFilter()
    },
    resetTemp() {
      this.temp = {
        state: 1,
        password: '',
        gender: 0,
        name: '',
        cellphone: '',
        nickname: ''
      }
    }

  }
}
</script>
<style rel="stylesheet/scss" lang="scss">
.timeInterval {
  top: -4px;
}
.table-expand {
  font-size: 0;
}
.table-expand label {
  width: 90px;
  color: #99a9bf;
}
.table-expand .el-form-item {
  margin-right: 0;
  margin-bottom: 0;
  width: 50%;
}
.avatar-uploader .el-upload {
  border: 1px dashed #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.avatar-uploader .el-upload:hover {
  border-color: #409eff;
}
.avatar-uploader-icon {
  font-size: 28px;
  color: #8c939d;
  width: 80px;
  height: 80px;
  line-height: 80px;
  text-align: center;
}
.avatar {
  width: 80px;
  height: 80px;
  display: block;
}
</style>
